<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LIN</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___l_i_n.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">LIN<div class="ingroups"><a class="el" href="group__grp__linlib.html">LINlib</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>LIN related functions.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga95408cd6c8639514b4be8e188bd7b38a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga95408cd6c8639514b4be8e188bd7b38a">linGetTransceiverData</a> (int channel, unsigned char eanNo[8], unsigned char serNo[8], int *ttype)</td></tr>
<tr class="separator:ga95408cd6c8639514b4be8e188bd7b38a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga040336f8176a10cb9578b47c42baef6b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga040336f8176a10cb9578b47c42baef6b">linOpenChannel</a> (int channel, int flags)</td></tr>
<tr class="separator:ga040336f8176a10cb9578b47c42baef6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d8cb59baccdefc9e772ad34c01c596f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga5d8cb59baccdefc9e772ad34c01c596f">linClose</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h)</td></tr>
<tr class="separator:ga5d8cb59baccdefc9e772ad34c01c596f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77e1463234ee6c67a71a2ab57f578b7f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga77e1463234ee6c67a71a2ab57f578b7f">linSetBitrate</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int bps)</td></tr>
<tr class="separator:ga77e1463234ee6c67a71a2ab57f578b7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga79ab73655c1749ad9fe2b784885e2dd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga79ab73655c1749ad9fe2b784885e2dd9">linBusOn</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h)</td></tr>
<tr class="separator:ga79ab73655c1749ad9fe2b784885e2dd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga051ffc0c24d6322825cbc8ff21e50744"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga051ffc0c24d6322825cbc8ff21e50744">linBusOff</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h)</td></tr>
<tr class="separator:ga051ffc0c24d6322825cbc8ff21e50744"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac012f34a621bc885bd582398c3d5d175"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int id, const void *msg, unsigned int dlc)</td></tr>
<tr class="separator:gac012f34a621bc885bd582398c3d5d175"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga068419b8b624d8918720a8907c4f9274"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga068419b8b624d8918720a8907c4f9274">linRequestMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int id)</td></tr>
<tr class="separator:ga068419b8b624d8918720a8907c4f9274"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaca2d874c870f16c11a4e8e158817d8bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int *id, void *msg, unsigned int *dlc, unsigned int *flags, <a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> *msgInfo)</td></tr>
<tr class="separator:gaca2d874c870f16c11a4e8e158817d8bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa2f729a931bf644ce62b373ab7414250"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#gaa2f729a931bf644ce62b373ab7414250">linReadMessageWait</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int *id, void *msg, unsigned int *dlc, unsigned int *flags, <a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> *msgInfo, unsigned long timeout)</td></tr>
<tr class="separator:gaa2f729a931bf644ce62b373ab7414250"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5bf84820248e95fde2718fa46304a5a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga5bf84820248e95fde2718fa46304a5a5">linUpdateMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int id, const void *msg, unsigned int dlc)</td></tr>
<tr class="separator:ga5bf84820248e95fde2718fa46304a5a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c89e03300af644cee54861f92ae567e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga1c89e03300af644cee54861f92ae567e">linSetupIllegalMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int id, unsigned int cFlags, unsigned int delay)</td></tr>
<tr class="separator:ga1c89e03300af644cee54861f92ae567e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga911287175a2ca5574a50d17b698b6d9d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga911287175a2ca5574a50d17b698b6d9d">linSetupLIN</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int lFlags, unsigned int bps)</td></tr>
<tr class="separator:ga911287175a2ca5574a50d17b698b6d9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4ba0a5256a785f3cc67a5e661837223e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga4ba0a5256a785f3cc67a5e661837223e">linWriteWakeup</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int count, unsigned int interval)</td></tr>
<tr class="separator:ga4ba0a5256a785f3cc67a5e661837223e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga905647480dd89a7225e4b8ae0d82cb92"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga905647480dd89a7225e4b8ae0d82cb92">linClearMessage</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int id)</td></tr>
<tr class="separator:ga905647480dd89a7225e4b8ae0d82cb92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1bd437b46f5923f05905c43cd4a1617a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#ga1bd437b46f5923f05905c43cd4a1617a">linWriteSync</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned long timeout)</td></tr>
<tr class="separator:ga1bd437b46f5923f05905c43cd4a1617a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadf904a2ba0101ac6dc622b6035cf0f5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_i_n.html#gadf904a2ba0101ac6dc622b6035cf0f5f">linGetCanHandle</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned int *<a class="el" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a>)</td></tr>
<tr class="separator:gadf904a2ba0101ac6dc622b6035cf0f5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>LIN related functions. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga051ffc0c24d6322825cbc8ff21e50744"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga051ffc0c24d6322825cbc8ff21e50744">&#9670;&nbsp;</a></span>linBusOff()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linBusOff </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Takes the specified handle off-bus.</p>
<dl class="section note"><dt>Note</dt><dd>Settings and slave message buffers will be reset to the default</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga79ab73655c1749ad9fe2b784885e2dd9">linBusOn()</a> </dd></dl>

</div>
</div>
<a id="ga79ab73655c1749ad9fe2b784885e2dd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga79ab73655c1749ad9fe2b784885e2dd9">&#9670;&nbsp;</a></span>linBusOn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linBusOn </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Takes the specified handle on-bus.</p>
<dl class="section note"><dt>Note</dt><dd>Settings and slave message buffers will be reset to the default if<br />
 used on a channel that is already on-bus.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga051ffc0c24d6322825cbc8ff21e50744">linBusOff()</a> </dd></dl>

</div>
</div>
<a id="ga905647480dd89a7225e4b8ae0d82cb92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga905647480dd89a7225e4b8ae0d82cb92">&#9670;&nbsp;</a></span>linClearMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linClearMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clear a message buffer for a LIN slave. The message buffer will not answer next time it is polled.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The LIN message id for which the corresponding buffer will be cleared.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga5d8cb59baccdefc9e772ad34c01c596f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d8cb59baccdefc9e772ad34c01c596f">&#9670;&nbsp;</a></span>linClose()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linClose </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Closes an open handle to a LIN channel. The handle becomes invalid and can not be used in subsequent calls to the LIN functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga040336f8176a10cb9578b47c42baef6b">linOpenChannel()</a> </dd></dl>

</div>
</div>
<a id="gadf904a2ba0101ac6dc622b6035cf0f5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadf904a2ba0101ac6dc622b6035cf0f5f">&#9670;&nbsp;</a></span>linGetCanHandle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linGetCanHandle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>canHandle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return the CAN handle given an open LIN handle</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">canHandle</td><td>A pointer to an integer where the CAN handle will be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga95408cd6c8639514b4be8e188bd7b38a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga95408cd6c8639514b4be8e188bd7b38a">&#9670;&nbsp;</a></span>linGetTransceiverData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linGetTransceiverData </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>eanNo</em>[8], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>serNo</em>[8], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>ttype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Retrieves the transceiver information for a CAN channel. The application typically uses this call to find out whether a particular CAN channel has a LIN interface connected to it. For a Kvaser LIN Leaf it retrieves the transceiver type and device information.</p>
<p>This function call will open the CAN channel, but no CAN messages are transmitted on it. In other words, it's risk-free to use even if no LIN interface is connected, or if the channel is connected to a CAN system.</p>
<dl class="section note"><dt>Note</dt><dd>Attempts to use the channel for LIN communication will be meaningful only if <a class="el" href="group___l_i_n.html#ga95408cd6c8639514b4be8e188bd7b38a">linGetTransceiverData()</a> stores <a class="el" href="canstat_8h.html#a355af023621874d0cc3e35094c83d121">canTRANSCEIVER_TYPE_LIN</a> or <a class="el" href="canstat_8h.html#a17d470ceba40a46555ce0f91641d31f1">canTRANSCEIVER_TYPE_CANFD_LIN</a> in <em>ttype</em>.</dd>
<dd>
A LIN interface need not be powered for this call to succeed.</dd>
<dd>
The information may not always be accurate. Especially after changing transceiver on a running LAPcan card, you should go on-bus and off-bus again to be sure the transceiver information is updated.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">channel</td><td>The number of a CAN channel for which the transceiver data will be retrieved. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">eanNo</td><td>A pointer to an array of 8 bytes where the EAN number of the LIN interface will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">serNo</td><td>A pointer to an array of 8 bytes where the serial number of the LIN interface will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ttype</td><td>A pointer to an integer where the transceiver type will be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lin__general.html#gafa260028be850e70a99c1b0706679583">linGetFirmwareVersion()</a> </dd></dl>

</div>
</div>
<a id="ga040336f8176a10cb9578b47c42baef6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga040336f8176a10cb9578b47c42baef6b">&#9670;&nbsp;</a></span>linOpenChannel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> linOpenChannel </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Open a channel to a LIN interface.</p>
<dl class="section note"><dt>Note</dt><dd>The device must be powered from the LIN side.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">channel</td><td>The number of the channel. Channel numbering is hardware dependent. This is the same channel number as used by <a class="el" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel()</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>Either one of the following values: <a class="el" href="linlib_8h.html#addf7881b12723497542ff0f66222c46e">LIN_MASTER</a> or <a class="el" href="linlib_8h.html#a9b19af88006130b3220a4ecb57cd4e0b">LIN_SLAVE</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If the call succeeds, a handle to the opened channel is returned. The handle is an integer greater than or equal to zero.</dd>
<dd>
If the call fails, the return value is a negative integer indicating an error code. See <a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> for a list of possible error codes.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga5d8cb59baccdefc9e772ad34c01c596f">linClose()</a> </dd></dl>

</div>
</div>
<a id="gaca2d874c870f16c11a4e8e158817d8bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaca2d874c870f16c11a4e8e158817d8bf">&#9670;&nbsp;</a></span>linReadMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linReadMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> *&#160;</td>
          <td class="paramname"><em>msgInfo</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read a message from the LIN interface. If a message is available for reception, <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> is returned. This is a non-blocking call. If no message is available in the LIN interface, an error code is returned.</p>
<dl class="section note"><dt>Note</dt><dd>This call will also return echoes of what the LIN interface is transmitting with <a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage</a>. In other words, the LIN interface can hear itself.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">id</td><td>A pointer to an integer where the identifier of the received LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>A pointer to a buffer where the data of the LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>A pointer to an integer where the length of the received LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flags</td><td>A combination of zero or more of the <a class="el" href="linlib_8h.html#LIN_xxx">LIN_xxx</a> flags. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msgInfo</td><td>A pointer to a <a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> struct where data about the received LIN message will be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#gaa2f729a931bf644ce62b373ab7414250">linReadMessageWait()</a> </dd></dl>

</div>
</div>
<a id="gaa2f729a931bf644ce62b373ab7414250"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa2f729a931bf644ce62b373ab7414250">&#9670;&nbsp;</a></span>linReadMessageWait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linReadMessageWait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>dlc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> *&#160;</td>
          <td class="paramname"><em>msgInfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read a message from the LIN interface. If a message is available for reception, <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> is returned. This is a blocking call. It waits until a message is received in the LIN interface, or the specified timeout period elapses.</p>
<dl class="section note"><dt>Note</dt><dd>This call will also return echoes of what the LIN interface is transmitting with <a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage()</a>. In other words, the LIN interface can hear itself.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The maximum number of milliseconds to wait for a message to be received by the LIN interface. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">id</td><td>A pointer to an integer where the identifier of the received LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>A pointer to a buffer where the data of the LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dlc</td><td>A pointer to an integer where the length of the received LIN message will be stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flags</td><td>A combination of zero or more of the <a class="el" href="linlib_8h.html#LIN_xxx">LIN_xxx</a> flags. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">msgInfo</td><td>A pointer to a <a class="el" href="struct_lin_message_info.html">LinMessageInfo</a> struct where data about the received LIN message will be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage()</a> </dd></dl>

</div>
</div>
<a id="ga068419b8b624d8918720a8907c4f9274"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga068419b8b624d8918720a8907c4f9274">&#9670;&nbsp;</a></span>linRequestMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linRequestMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function writes a LIN message header to the LIN bus. A slave in the system is then expected to fill in the header with data.</p>
<dl class="section note"><dt>Note</dt><dd>This call is only available in master mode.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the LIN message.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="page_linlib.html#section_user_guide_lin_frame_identifiers">LIN Frame Identifiers</a> </dd></dl>

</div>
</div>
<a id="ga77e1463234ee6c67a71a2ab57f578b7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga77e1463234ee6c67a71a2ab57f578b7f">&#9670;&nbsp;</a></span>linSetBitrate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linSetBitrate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>bps</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function sets the bit rate for a master, or the initial bit rate for a slave.</p>
<dl class="section note"><dt>Note</dt><dd>The handle shall be off-bus.</dd>
<dd>
Supported bit rates according to the LIN standard are 1000 - 20000 bits per second. No check of the bps parameter is done inside LINlib.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bps</td><td>Bit rate in bits per second.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga1c89e03300af644cee54861f92ae567e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1c89e03300af644cee54861f92ae567e">&#9670;&nbsp;</a></span>linSetupIllegalMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linSetupIllegalMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>cFlags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>delay</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Using this function, it is possible to use the LIN interface to create corrupted LIN messages. You call the function once for each LIN identifier that should be affected.</p>
<p>To return to normal mode, either restart the LIN interface (by going off bus and on the bus again) or call the function with delay and <em>cFlags</em> set to zero.</p>
<dl class="section note"><dt>Note</dt><dd>The handle shall be on-bus. </dd>
<dd>
Not supported by all devices.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the LIN message. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cFlags</td><td>One or more of the <a class="el" href="linlib_8h.html#LIN_MSG_DISTURB_xxx">LIN_MSG_DISTURB_xxx</a> or <a class="el" href="linlib_8h.html#LIN_MSG_USE_xxx">LIN_MSG_USE_xxx</a> flags. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">delay</td><td>The delay parameter will result in a delay of this many bittimes after the header and before the first data byte.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga911287175a2ca5574a50d17b698b6d9d">linSetupLIN()</a> </dd></dl>

</div>
</div>
<a id="ga911287175a2ca5574a50d17b698b6d9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga911287175a2ca5574a50d17b698b6d9d">&#9670;&nbsp;</a></span>linSetupLIN()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linSetupLIN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>lFlags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>bps</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function changes various settings on a handle that is on-bus. When going on-bus, the bit rate and the flag values listed below are set to the default value (either as hard-coded in the firmware, or as stored in the non-volatile memory of the LIN Interface).</p>
<p>With this function, you can do one or more of the following things:</p><ul>
<li>Select checksum according to LIN 2.0</li>
<li>Turn variable message length off. The message length then will depend on the message ID.</li>
</ul>
<p>In master mode it is also possible to change the bit rate without going off bus first.</p>
<dl class="section note"><dt>Note</dt><dd>The handle shall be on-bus. </dd>
<dd>
It is supported in firmware version 2.5.1 and later. </dd>
<dd>
For LIN 2.0 compliance, you must specify both <a class="el" href="linlib_8h.html#a937225a25c3c24efabf7c8438ccecd09">LIN_ENHANCED_CHECKSUM</a> and <a class="el" href="linlib_8h.html#a2edd31e15abb5f7cb8dd213fd707dfff">LIN_VARIABLE_DLC</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">lFlags</td><td>One or more of the following flags: <a class="el" href="linlib_8h.html#a937225a25c3c24efabf7c8438ccecd09">LIN_ENHANCED_CHECKSUM</a>, <a class="el" href="linlib_8h.html#a2edd31e15abb5f7cb8dd213fd707dfff">LIN_VARIABLE_DLC</a> </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">bps</td><td>Specifies the bit rate in bits per second. This parameter can be used only in master mode. The bit rate is set without going off bus.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga1c89e03300af644cee54861f92ae567e">linSetupIllegalMessage()</a> </dd>
<dd>
<a class="el" href="page_linlib.html#section_user_guide_lin_frame_identifiers">LIN Frame Identifiers</a> </dd></dl>

</div>
</div>
<a id="ga5bf84820248e95fde2718fa46304a5a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5bf84820248e95fde2718fa46304a5a5">&#9670;&nbsp;</a></span>linUpdateMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linUpdateMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>dlc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function updates a message buffer in a slave. The contents of the message buffer will be used the next time the slave is polled for the specified LIN message id.</p>
<dl class="section note"><dt>Note</dt><dd>The handle shall be on-bus.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the LIN message. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>A pointer to a buffer containing the data of the LIN message. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dlc</td><td>The length of the LIN message.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga905647480dd89a7225e4b8ae0d82cb92">linClearMessage()</a> </dd>
<dd>
<a class="el" href="page_linlib.html#section_user_guide_lin_frame_identifiers">LIN Frame Identifiers</a> </dd></dl>

</div>
</div>
<a id="gac012f34a621bc885bd582398c3d5d175"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac012f34a621bc885bd582398c3d5d175">&#9670;&nbsp;</a></span>linWriteMessage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linWriteMessage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>dlc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write a LIN message. It is advisable to wait until the message is echoed by <a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage()</a> before transmitting a new message, or in case of a schedule table being used, transmit the next message when the previous one is known to be complete.</p>
<dl class="section note"><dt>Note</dt><dd>Only available in master mode.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>The identifier of the LIN message. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>A pointer to a buffer containing the data of the LIN message. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dlc</td><td>The length of the LIN message.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga1bd437b46f5923f05905c43cd4a1617a">linWriteSync()</a> </dd>
<dd>
<a class="el" href="page_linlib.html#section_user_guide_lin_frame_identifiers">LIN Frame Identifiers</a> </dd></dl>

</div>
</div>
<a id="ga1bd437b46f5923f05905c43cd4a1617a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1bd437b46f5923f05905c43cd4a1617a">&#9670;&nbsp;</a></span>linWriteSync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linWriteSync </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call this function to make sure all messages transmitted to the LIN Interface has been received by it.</p>
<p>When messages are transmitted to the LIN Interface, they are queued by the driver before appearing on the LIN bus.</p>
<p>The function returns <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> if all writes are done, <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14adc6a77eefd0c6e821dddc048dc9355a5">linERR_TIMEOUT</a> in case of timeout or possibly some other error code.</p>
<p>If the LIN Interface is in master mode and a LIN message has been transmitted with <a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage()</a>, this function will return when the LIN Interface has received the message. If another LIN message is being received or transmitted, the message will not be transmitted on the LIN bus at once. And even if the LIN Interface is idle, the header of the new message will just have been started when <a class="el" href="group___l_i_n.html#ga1bd437b46f5923f05905c43cd4a1617a">linWriteSync()</a> returns.</p>
<p>After calling <a class="el" href="group___l_i_n.html#ga5bf84820248e95fde2718fa46304a5a5">linUpdateMessage()</a> and <a class="el" href="group___l_i_n.html#ga905647480dd89a7225e4b8ae0d82cb92">linClearMessage()</a> for a slave, this function is enough to know that the LIN Interface is updated.</p>
<p>After <a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage()</a>, it is advisable to wait until the message is echoed by <a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage()</a> before transmitting a new message, or in case of a schedule table being used, transmit the next message when the previous one is known to be complete.</p>
<p>When, in master mode, a message should be transmitted after a poll (reception) is done, it might be necessary to call <a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage()</a> before the result is received via <a class="el" href="group___l_i_n.html#gaca2d874c870f16c11a4e8e158817d8bf">linReadMessage()</a> as the LIN Interface waits up to the maximum frame length before knowing a received message is complete. A new message to transmit will force completion if the currently received one.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>The maximum number of milliseconds to wait for the queued messages to be transmitted by the LIN interface.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#gac012f34a621bc885bd582398c3d5d175">linWriteMessage()</a> </dd></dl>

</div>
</div>
<a id="ga4ba0a5256a785f3cc67a5e661837223e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ba0a5256a785f3cc67a5e661837223e">&#9670;&nbsp;</a></span>linWriteWakeup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linWriteWakeup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>interval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write a wakeup frame.</p>
<p>If count is zero, one single wakeup frame is transmitted. If count &gt; 1, several wakeup frames are transmitted spaced with 'interval' bittimes. The LIN interface will interrupt the sequence when a LIN message or another command is received. The stream of wakeups will be recived as incoming messages with the LIN_RX flag bit set.</p>
<dl class="section note"><dt>Note</dt><dd>Maximum value of count is 255 (0xFF). </dd>
<dd>
Maximum value of interval is either 255 (0xFF) or 65535 (0xFFFF) depending on device.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>The number of wakeup frames to send. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">interval</td><td>The time, in bit times, between the wakeup frames.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
